import request from '@/utils/request'

// 获取订单交易数据
export const reqGetTrade = () => {
  return request({
    method: 'get',
    url: '/order/auth/trade',
  })
}

// 获取提交订单信息
export const reqSubmitOrder = ({ tradeNo, ...data }) => {
  return request({
    method: 'post',
    url: '/order/auth/submitOrder',
    // 携带query查询字符串参数
    params: {
      tradeNo,
    },
    data,
  })
}

// 获取二维码
export const reqGetPayQRcode = (orderId) => {
  return request({
    method: 'get',
    url: `/payment/weixin/createNative/${orderId}`,
  })
}

// 查询订单支付状态
export const reqGetPayOrderStatus = (orderId) => {
  return request({
    method: 'get',
    url: `/payment/weixin/queryPayStatus/${orderId}`,
  })
}
